package com.uchedao.seller.widget.loadstate.base;

import android.content.Context;
import android.util.AttributeSet;

/**
 * @ClassName: LoadstateHttpRelativityLayout 不重复加载布局
 * @author wushan
 * @date 2014-9-1 下午2:22:57
 *
 */
public abstract class LoadstateHttpRelativityLayout extends
		LoadstateRelativeLayout implements ILazyLoad {
	private boolean isLoad = true;// 是否第一次加载

	public LoadstateHttpRelativityLayout(Context context) {
		super(context);

	}

	public LoadstateHttpRelativityLayout(Context context, AttributeSet attrs) {
		super(context, attrs);

	}

	public LoadstateHttpRelativityLayout(Context context, AttributeSet attrs,
			int defStyle) {
		super(context, attrs, defStyle);

	}

	@Override
	public void onLoadSuccess() {
		isLoad = false;
		super.onLoadSuccess();
	}

	@Override
	public void onLoadFailed() {
		isLoad = true;
		super.onLoadFailed();
	}

	@Override
	public void onLoadEmpty() {
		isLoad = true;
		super.onLoadEmpty();
	}

	@Override
	public boolean firstdata() {
		if (isLoad) {
			onLoadStart();
			loadData(1);
			return true;
		}
		return false;
		
	}

}
